home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / glibc108.gz / glibc108 / glibc-1.08.1 / sysdeps / m68k / fpu / switch / Makefile < prev    next >
Makefile  |  1992-05-01  |  2KB  |  53 lines

  1. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License as
  6. # published by the Free Software Foundation; either version 2 of the
  7. # License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. ifeq ($(subdir),math)
  20.  
  21. sysdep_routines := $(sysdep_routines) switch
  22.  
  23. # Find all the sources that have 68881 versions.
  24. +68881-sources := \
  25.   $(notdir $(wildcard $(addprefix $(filter %/fpu,$(sysdirs)),$(sources))))
  26.  
  27. # Sysdep directories other than fpu and fpu/switch (this one).
  28. +non68881-dirs := $(filter-out %/fpu %/fpu/switch,$(+sysdep_dirs))
  29.  
  30. # Get a non-68881 version of the target.
  31. +non68881-version = $(firstword $(wildcard $(addsuffix /$@,$(+non68881-dirs))))
  32.  
  33. # Directory containing 68881 sources.
  34. +68881-dir := $(filter %/fpu,$(+sysdep_dirs))
  35.  
  36. # For all the files that have 68881 versions and don't exist already in
  37. # the source directory (math), automatically make ones that switch between
  38. # 68881 and soft versions.
  39. $(addprefix $(objpfx), \
  40.         $(filter-out $(wildcard $(+68881-sources)),$(+68881-sources))):
  41.     (echo '#include <ansidecl.h>'        ;\
  42.      echo '#include <68881-sw.h>'        ;\
  43.      echo '#define $* __$*_68881'        ;\
  44.      echo '#include <$(+68881-dir)/$@>'    ;\
  45.      echo '#undef $*'            ;\
  46.      echo '#define $* __$*_soft'        ;\
  47.      echo '#include <$(non68881-version)>'    ;\
  48.      echo '#undef $*'            ;\
  49.      echo 'switching_function($*);') > $@-tmp
  50.     mv $@-tmp $@
  51.  
  52. endif
  53.